    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <script type="text/javascript">
        window.addEventListener("load",eventWindowLoaded,false);
        function eventWindowLoaded(){
            canvasApp();
        }
        function canvasApp(){
            var theCanvas=document.getElementById("canvas");
            var context=theCanvas.getContext("2d")
            //draw a big box on the screen
            context.fillStyle="black";//
            context.fillRect(10,10,200,200);

            context.fillStyle="red";
            context.fillRect(1,1,50,50);
            context.globalCompositeOperation="source-over";

            context.fillRect(60,1,50,50);
            
            context.fillRect(1,60,50,50);
            context.globalAlpha=.5;
            context.globalCompositeOperation="source-atop";

            context.fillRect(60,60,50,50);
        }
        //lineCap:butt,square,round;
        //lineJoin:miter,bevel,round;Sans-Serif
        </script>
        <title>Document</title>
    </head>
    <body>
        <div style="position:absolute;top:50px;left:50px">
            <canvas id="canvas" height="500" width="500">Your browser does not support HTML5 Canvas.</canvas>
        </div>
    </body>
    </html>